import { defineStore } from 'pinia'

export const useTalkStore = defineStore('talk', {
  state: () => ({ talkList: JSON.parse(localStorage.getItem('talkList') as string)||[] }),
  actions: {
    addTalk(value:any) {
      this.talkList.push(value)
    }
  },
  getters:{
    allTalk():any{
        return this.talkList.map((it:any)=>{return {...it,content:it.title}})
    }
  }
})
